<?php
namespace Common\Model;
use Think\Model;

class MessagesModel extends VRUserModel
{
    //显示留言墙列表
    function getList($wall_id,$pageStart, $pageSize){
        $res['count'] = $this->where("wall_id = $wall_id and status = 0")->count();
        $res['data']  = $this->where("wall_id = $wall_id and status = 0")
                        ->limit($pageStart, $pageSize)->Order("create_time desc")->select();

        return $res;
    }
    
    //查看 留言详情
    function getOne($id){
        $res = $this->where("id = $id")->find();
        return $res;
    }
    
    //编辑留言
    function editmes($id,$data){
        $res = $this->where("id = $id")->data($data)->save();
        return $res;
    }

    //删除 留言
    function mesdel($id){
        $data['status'] = 1;
        $res = $this->where("id = $id")->data($data)->save();
        return $res;
    }
    


}